package com.quyeying.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>
 * 订单商品信息表
 * </p>
 *
 * @author skx
 * @since 2022-07-19
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("tbl_order_product")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TblOrderProductEntity extends Model<TblOrderProductEntity> {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单id
     */
    private Long orderId;

    /**
     * 商品id
     */
    private Long productId;

    /**
     * 商品名称
     */
    private String productName;

    /**
     * 商品扩展信息1
     */
    @TableField("product_extend_I")
    private String productExtendI;

    /**
     * 商品扩展信息2
     */
    @TableField("product_extend_II")
    private String productExtendIi;

    /**
     * 商品图片
     */
    private String productImage;

    /**
     * 商品数量
     */
    private Integer productNo;

    /**
     * 商品单价
     */
    private BigDecimal productUnitPrice;

    /**
     * 商品浏览量
     * @return
     */
    @TableField(exist = false)
    private Long productBrowse;


    /**
     * 商品规格id
     * @return
     */
    @TableField(exist = false)
    private Long productSkuId;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
